import { AccountRegType, AccountType, RoleType } from "@/types/user";
import request from "../utils/request";

//登录请求
export const userLogin = (account: AccountType) => {
  return request.post("/login", account);
};

//注册请求
export const userReg = (reg: AccountRegType) => {
  return request.post("/users", reg);
};

//新增角色
export const rolePost = (role: RoleType) => {
  return request.post("/classes/ReactRole", role);
};

export const roleGet = (id?: string) => {
  let query = id ? `/${id}` : "";
  return request.get(`/classes/ReactRole${query}`);
};
